<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      function ucFirst(str) {
        // str = 'john';
        return str[0].toUpperCase() + str.substr(1);
      }
      console.log(ucFirst("john")); // John
    </script>
  </body>
</html>
